package com.financing.wap.service.impl;


import java.sql.SQLException;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.financing.wap.dao.IFpShopInformationDao;
import com.financing.wap.dto.FpShopInformationDTO;
import com.financing.wap.service.IFpShopInformationService;
import com.financing.wap.util.DTOdateSetUtil;
/**
 * fp_shop_information  
 *  业务访问层实现类
 * @author huqiyun
 *
 */
 
@Repository("fpShopInformationService")
public class FpShopInformationServiceImpl implements IFpShopInformationService{

	@Autowired
	private IFpShopInformationDao fpShopInformationDao;

	@Override
	public int insert(FpShopInformationDTO fpShopInformation) throws SQLException {
		DTOdateSetUtil.setCreateInfo(fpShopInformation);
		DTOdateSetUtil.setUpdateInfo(fpShopInformation);
//		fpShopInformation.setDeleteTag(CommonStatus.DELETE_TAG_NORMAL);
		return fpShopInformationDao.insert(fpShopInformation);
	}

	@Override
	public void update(FpShopInformationDTO fpShopInformation) throws SQLException {
		DTOdateSetUtil.setUpdateInfo(fpShopInformation);
		fpShopInformationDao.update(fpShopInformation);
	}

	@Override
	public void updateForce(FpShopInformationDTO fpShopInformation) throws SQLException {
		DTOdateSetUtil.setUpdateInfo(fpShopInformation);
		fpShopInformationDao.updateForce(fpShopInformation);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		fpShopInformationDao.delete(id);
	}
	
	@Override
	public List<FpShopInformationDTO> queryList(FpShopInformationDTO fpShopInformation) throws SQLException {
		return fpShopInformationDao.queryList(fpShopInformation);
	}

	@Override
	public int queryListCount(FpShopInformationDTO fpShopInformation) throws SQLException {
		return fpShopInformationDao.queryListCount(fpShopInformation);
	}

	@Override
	public FpShopInformationDTO loadById(Integer id) throws SQLException {
		return fpShopInformationDao.loadById(id);
	}
 	@Override
	public FpShopInformationDTO queryListGetFirst(FpShopInformationDTO fpShopInformation)
			throws SQLException {
		 List<FpShopInformationDTO> queryList = queryList(fpShopInformation);
		 if(queryList==null||queryList.size()==0){
			 return new FpShopInformationDTO();
		 }
		 return queryList.get(0);
	}

	@Override
	public List<FpShopInformationDTO> queryCurdayInformations(
			FpShopInformationDTO fpShopInformation) throws SQLException {
		return fpShopInformationDao.queryCurdayInformations(fpShopInformation);
	}
}
